#include "mypeopleinfo.h"

#include<QFileInfo>
#include<QMessageBox>
#include<QFile>
#include<QLibrary>
#include<QLineEdit>
#include<QHBoxLayout>
#include<QSpacerItem>
#include<QLabel>
#include<QPushButton>
#include<QApplication>
#include<QProcess>
#include<qDebug>
#include <QStandardPaths>
#include<QTimer>
#include<QDir>

#include"windows.h"
#include"shellapi.h"
#include"Winbase.h"
MyPeopleInfo::MyPeopleInfo(QWidget *parent) :
  QWidget(parent,Qt::WindowStaysOnTopHint)
{

  create();

  connect(btn1,SIGNAL(clicked()),this,SLOT(btn1Slots()));

  connect(btn2,SIGNAL(clicked()),this,SLOT(btn2Slots()));

}

MyPeopleInfo::~MyPeopleInfo()
{
  delete btn1;
  btn1 = nullptr;
  delete btn2;
  btn2 = nullptr;
}



void MyPeopleInfo::create()
{
  setWindowTitle("人员检录");
  setFixedSize(550,200);

  btn1 = new QPushButton("开始录入",this);
  btn1->setFixedSize(180,60);

  btn2 = new QPushButton("结束录入",this);
  btn2->setFixedSize(180,60);

  //弹簧
  QSpacerItem *h_spacer = new QSpacerItem(10,10,QSizePolicy::Expanding,QSizePolicy::Minimum);

  QHBoxLayout *layout= new QHBoxLayout(this);

  layout->addItem(h_spacer);
  layout->addWidget(btn1);
  layout->addItem(h_spacer);
  layout->addWidget(btn2);
  layout->addItem(h_spacer);
  setLayout(layout);
  setStyleSheet("QPushButton,QLineEdit{width: 100px;height: 100px;font-size: 30px;font-bold;font-family: 微软雅黑;}");
}

void MyPeopleInfo::btn1Slots()
{

  btn1->setEnabled(false);
  btn1->setText("正在录入...");
  emit mySignalOpen();
}

void MyPeopleInfo::btn2Slots()
{
  btn1->setEnabled(true);
  btn1->setText("开始录入");
  emit mySignalClose();
}



